import request from '@/utils/request';
import type { FormTipsType } from './data';

export async function getTipsList(params) {
  return request('/api/v1/tips/getList', {
    method: 'GET',
    params,
  });
}
export async function createTips(params: FormTipsType) {
  return request('/api/v1/tips/createRecord', {
    method: 'POST',
    data: {
      ...params,
    },
  });
}
export async function updateTips(params: FormTipsType) {
  return request(`/api/v1/tips/updateRecord/${params.id}`, {
    method: 'PUT',
    data: {
      ...params,
    },
  });
}

export async function deleteTips(id: number) {
  return request(`/api/v1/tips/deleteRecord/${id}`, {
    method: 'DELETE',
  });
}
